package com.jochen.core.android

import android.os.Bundle
import android.view.KeyEvent
import com.badlogic.gdx.backends.android.AndroidApplication
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration

import com.jochen.core.world.GdxGame

class AndroidGdxLauncher():AndroidApplication(){
    
    override fun onCreate(savedInstanceState: Bundle?){
        super.onCreate(savedInstanceState)
        UncaughtExceptionHandler.init(this, AndroidGdxLauncher::class.java)
        val cfg = AndroidApplicationConfiguration()
		cfg.useImmersiveMode = true;
		initialize(GdxGame(), cfg);

    }
    
    fun initLaunchOptions(){
        ScreenUtils.hideBlackBar(this)
    }
    
    override fun onKeyDown(keyCode: Int,event: KeyEvent): Boolean{
        if (keyCode == KeyEvent.KEYCODE_BACK) {
			return true
		}
        return super.onKeyDown(keyCode, event)
    }
}
